/**
 * 算珠网关相关类型定义
 */

// 基础状态枚举
export enum StatusEnum {
  DISABLED = 0,
  ENABLED = 1
}

// 应用类型枚举
export enum AppTypeEnum {
  WEB = 1,
  MOBILE = 2,
  MINI_PROGRAM = 3
}

// 连接模式枚举
export enum ConnectModeEnum {
  DIRECT = 1,
  PROXY = 2
}

// 服务商类型枚举
export enum ProviderTypeEnum {
  PLATFORM = 1,
  THIRD_PARTY = 2
}

// 二维码信息DTO
export interface PayDeviceQrcodeDTO {
  qrcodeId: string
  merchantId: string
  storeId?: string
  appId: string
  batchId?: string
  status: StatusEnum
  qrCodeUrl?: string
  remark?: string
  extrainfo?: string
  createdTime?: string
  updatedTime?: string
}

// 应用配置信息DTO
export interface PaymentAppConfigDTO {
  appId: string
  appName?: string
  appType: AppTypeEnum
  connectMode: ConnectModeEnum
  merchantId: string
  notifyUrl?: string
  returnUrl?: string
  status: StatusEnum
  createdTime?: string
  updatedTime?: string
}

// 商户信息DTO
export interface MerchantInfoDTO {
  merchantId: string
  merchantName?: string
  providerId?: string
  agentId?: string
  status: StatusEnum
  contactName?: string
  contactTelephone?: string
  remark?: string
  createdTime?: string
  updatedTime?: string
}

// 服务商信息DTO
export interface ServiceProviderDTO {
  providerId: string
  providerName?: string
  providerType: ProviderTypeEnum
  contactPerson?: string
  contactPhone?: string
  contactEmail?: string
  merchantCount?: number
  status: StatusEnum
  createdTime?: string
  updatedTime?: string
}

// 算珠网关响应数据结构
export interface SuanzhuGatewayResponse {
  qrcodeInfo?: PayDeviceQrcodeDTO
  appInfo?: PaymentAppConfigDTO
  merchantInfo?: MerchantInfoDTO
  serviceProviderInfo?: ServiceProviderDTO
  error?: string
}

// API响应结构
export interface ApiResponse<T> {
  success: boolean
  data?: T
  message?: string
  code?: number
}

// 状态格式化结果
export interface StatusFormat {
  text: string
  color: string
}

// 环境类型
export type EnvironmentType = 'Browser' | 'WeChat' | 'Alipay' | 'QQ'

// 页面类型
export type PageType = 'WXPAY_H5' | 'ALIPAY_H5' | 'NORMAL_BROWSER_H5'